package com.sia.springcloud.heartbeat;

import org.quartz.JobExecutionContext;
import org.quartz.SchedulerException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: Sirius
 * @Date: 2022/1/3 12:07
 * @Description: 2022/5/9 注释掉@Component，防止自动注入，避免使用心跳检测
 **/
//@Component
public class HeartbeatApi {

    @Resource
    private HeartbeatRunner heartbeatRunner;

    //发送一次心跳
    public void beat(){
        try {
            heartbeatRunner.beat();
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
    }

}
